package cn.zhl.设计模式.访问者;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: demos
 * @description:
 * @author: 刘振华
 * @create: 2021-03-22 17:09
 **/
public class PersonStucs {
	private List<Person> persons = new ArrayList<>();
	public void add(Person person){
		persons.add(person);
	}

	public void display(Action action){
		System.out.println(persons.size());
		persons.forEach(t-> t.accept(action));
	}
}
